<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
	</head>
	<body>
		<div id="app">
			<input type="text" placeholder="键盘事件..." @keyup.enter="fn1($event)" />
		</div>
		<script type="text/javascript">
			let vm = new Vue({
				el: '#app',
				data: {
					counter: 0
				},
				methods: {
					fn1: function(event) {
						console.log(event.keyCode);
						if(event.keyCode == 13){
							console.log("----------");
						}
					}
				}
			})
		</script>
	</body>
</html>
